/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package vista;
import pruebas.*;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Image;
import javax.swing.ImageIcon;

/**
 * http://jc-mouse.blogspot.com/
 * @author Mouse
 */
public class panelImagenFondo extends javax.swing.JPanel {
  String url;

    public panelImagenFondo(Dimension t,String url){    
//        this.setSize(400,280);
        this.setSize(t);
        this.url=url;
    }
        
    @Override
    public void paint(Graphics g){
        Image imagen = new ImageIcon(getClass().getResource(url)).getImage();  
        g.drawImage(imagen, 0, 0, getWidth(), getHeight(), this);
        setOpaque(false);
        super.paintComponent(g);
    }    
}
